package com.appwoo.txtws.service;

import android.content.Context;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.WallpaperBean;
import com.appwoo.txtws.component.Logger;
import java.io.IOException;
import java.util.ArrayList;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class WallpaperService
{
  private final String GET_WALLPAPER = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>%s</SNDR><TYPE>RQWallpaper</TYPE></HEAD><BODY><ID>%d</ID><PageIndex>%d</PageIndex><PageSize>%d</PageSize></BODY></MSG>";

  public ArrayList<WallpaperBean> getWebWallpaperListInfo(Context paramContext, String paramString, int paramInt1, int paramInt2, int paramInt3)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    ArrayList localArrayList = new ArrayList();
    MsgService localMsgService = new MsgService();
    Object[] arrayOfObject = new Object[4];
    arrayOfObject[0] = paramString;
    arrayOfObject[1] = Integer.valueOf(paramInt1);
    arrayOfObject[2] = Integer.valueOf(paramInt2);
    arrayOfObject[3] = Integer.valueOf(paramInt3);
    String str1 = String.format("<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>%s</SNDR><TYPE>RQWallpaper</TYPE></HEAD><BODY><ID>%d</ID><PageIndex>%d</PageIndex><PageSize>%d</PageSize></BODY></MSG>", arrayOfObject);
    Logger.e("REQUEST WALLPAPER WEB INFO", str1);
    String str2 = localMsgService.sendMessage(paramString, str1, paramContext);
    Logger.e("RESPONSE WALLPAPER WEB INFO", str2);
    XmlPullParser localXmlPullParser;
    int i;
    WallpaperBean localWallpaperBean;
    if ((str2 != null) && (!"".equals(str2)))
    {
      localXmlPullParser = PullIO.getPullByString(str2);
      i = localXmlPullParser.getEventType();
      localWallpaperBean = null;
      if (i != 1);
    }
    else
    {
      return localArrayList;
    }
    switch (i)
    {
    case 0:
    case 1:
    default:
    case 2:
    case 3:
    }
    while (true)
    {
      i = localXmlPullParser.next();
      break;
      if ("List".equalsIgnoreCase(localXmlPullParser.getName()))
      {
        localWallpaperBean = new WallpaperBean();
        localWallpaperBean.setType("web");
      }
      else if ("ID".equalsIgnoreCase(localXmlPullParser.getName()))
      {
        localWallpaperBean.setWebId(Integer.valueOf(localXmlPullParser.nextText()).intValue());
      }
      else if ("SmallUrl".equalsIgnoreCase(localXmlPullParser.getName()))
      {
        localWallpaperBean.setUrlSmall(localXmlPullParser.nextText());
      }
      else if ("LargeUrl".equalsIgnoreCase(localXmlPullParser.getName()))
      {
        localWallpaperBean.setUrlLarge(localXmlPullParser.nextText());
      }
      else if ("UpdateTime".equalsIgnoreCase(localXmlPullParser.getName()))
      {
        localWallpaperBean.setUpdateTime(localXmlPullParser.nextText());
        continue;
        if ("List".equalsIgnoreCase(localXmlPullParser.getName()))
        {
          localWallpaperBean.setType("web");
          localWallpaperBean.setName(localWallpaperBean.getUrlLarge().substring(1 + localWallpaperBean.getUrlLarge().lastIndexOf("/")));
          localArrayList.add(localWallpaperBean);
        }
      }
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.WallpaperService
 * JD-Core Version:    0.6.2
 */